Skip to content

[nrf fromlist] drivers: serial: nrfx_uarte: Fix low power mode when R… #2470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2,296 commits into
base: main
Choose a base branch
from

Conversation

nordic-krch
Copy link
Contributor

…X is disabled

Macros for determining is low power mode shall be used where incorrect. UARTE_ANY_LOW_POWER was taking into account only instances which had CONFIG_UART_x_NRF_ASYNC_LOW_POWER enabled. There are also instances with property which also can use low power mode. Created IS_LOW_POWER_INST macro which correctly determines if instance is using low power mode.

Upstream PR #: 85370

…ities and FAE table"

This reverts commit 2efd4bc.

Signed-off-by: Andrzej Głąbek <[email protected]>
…t critical"

This reverts commit 43734cb.

Signed-off-by: Andrzej Głąbek <[email protected]>
… and bucken from dt"

This reverts commit 1f00ee2.

Signed-off-by: Andrzej Głąbek <[email protected]>
This reverts commit 7c0953b.

Signed-off-by: Andrzej Głąbek <[email protected]>
…electable"

This reverts commit fcc4bcf.

Signed-off-by: Andrzej Głąbek <[email protected]>
…() revision handling"

This reverts commit f1ba687.

Signed-off-by: Andrzej Głąbek <[email protected]>
…OUNTER_AHEAD`"

This reverts commit aa05262.

Signed-off-by: Andrzej Głąbek <[email protected]>
…mer test"

This reverts commit a6fd92d.

Signed-off-by: Andrzej Głąbek <[email protected]>
… access"

This reverts commit c084162.

Signed-off-by: Andrzej Głąbek <[email protected]>
…tness"

This reverts commit 6bbdba5.

Signed-off-by: Andrzej Głąbek <[email protected]>
This reverts commit 94e326f.

Signed-off-by: Andrzej Głąbek <[email protected]>
…t name in dts.cmake"

This reverts commit 4cd36a9.

Signed-off-by: Andrzej Głąbek <[email protected]>
…s for run once config"

This reverts commit b8b1c0b.

Signed-off-by: Andrzej Głąbek <[email protected]>
…un once config"

This reverts commit 0431663.

Signed-off-by: Andrzej Głąbek <[email protected]>
…oC extension"

This reverts commit 0344c2d.

Signed-off-by: Andrzej Głąbek <[email protected]>
This reverts commit 15c21aa.

Signed-off-by: Andrzej Głąbek <[email protected]>
This reverts commit fe2bd33.

Signed-off-by: Andrzej Głąbek <[email protected]>
piotrkoziar and others added 28 commits February 12, 2025 11:30
Refactors the code to avoid 'unused variable' warning
that is problematic for some builds.

Signed-off-by: Piotr Koziar <[email protected]>
(cherry picked from commit 8f83ffc)
This is a follow-up to commit 12eee61.

Explicitly enable "PSA_WANT_ALG_ECB_NO_PADDING" to select the AES ECB
mode that it is used in CMAC operation.

This is done because CMAC uses AES-ECB, so both AES and ECB must
be explicitly enabled. Previously it worked because Mbed TLS is
not currently performing any check internally on this and it's
just enabling ECB automatically.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit dff78b4)
Define HSFLL120 clock.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 332a335)
Due to a copy-paste error, it duplicated `ttgo_lora32/esp32/procpu`.
Also, remove the `lora` tag, as it seems to be omitted from devicetree.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit c074661)
test_k_workqueue_stop uses an uninitialized variable, causing
sporadic test failures.

Signed-off-by: Robin Kastberg <[email protected]>
(cherry picked from commit 75daa43)
nRF boards have a ROM crunch esp. with combined with Matter/networking
features, as the advanced features are not essential for typical Wi-Fi
operation, disable them by default. Individual samples can choose to
enable it.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit e161ad6)
…rver

The unicast server does not need GATT caching and it was likely
incorrectly added earlier as a dependency.

Upstream PR #: 84232

Signed-off-by: Emil Gydesen <[email protected]>
… updates

-Update hostap to PR nrfconnect#76 which adds support for
 CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG instead of relying on legacy
 Mbed TLS ctr_drbg and entropy APIs. This change is in line with
 PSA crypto entropy changes in Zephyr happening with TinyCrypt
 deprecation and advancement of PSA crypto mechanisms
-Remove defconfigs for currently sets the Kconfigs:
 -CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
 -CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG

Upstream PR #: 84517

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
…endencies

-PSA_WANT_ALG_CMAC must be set for PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128
 to be valid. This commit fixes this mismatch for hostap

Upstream PR #: 84517

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
…nfigurations

-Mbed TLS has come up with its own naming-convention with regards
 to certain Mbed TLS configurations for TLS/DTLS and X.509. This
 commit fixes a couple of them by depending on MBEDTLS_BUILTIN
 which is set when Kconfig.tls-generic is used
 1. Make MBEDTLS_PEM_CERTIFICATE_FORMAT depend on MBEDTLS_BUILTIN
    The proper name for this functionaity is MBEDTL_PEM_PARSE_C and
    MBEDTLS_PEM_WRITE_C
 2. Make MBEDTLS_SERVER_NAME_INDICATION depend on MBEDTLS_BUILTIN
    The proper name for this is MBEDTLS_SSL_SERVER_NAME_INDICATION

Upstream PR #: 84517

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
Problem
-------

Board & SoC extensions are used to define out-of-tree board variants or
SoC qualifiers. When a board is extended, it has multiple directories
associated with it (each with its own `board.yml`), where twister should
be able to find additional platform files to support these qualifiers.
Currently, this doesn't work, because twister only traverses the primary
BOARD_DIR and ignores the rest.

The fix would've been trivial in the case of "legacy" platform files,
i.e. those of the form `<normalized_board_target>.yaml`, but it's less
straightforward for the newly introduced `twister.yaml` format.

A `twister.yaml` file contains platform configuration that can be shared
by multiple board targets and tweaked for specific targets by using the
top-level `variants` key. Normally, there is at most one `twister.yaml`
per board, but the file isn't necessarily unique to one board. Instead,
it's unique to one directory, which may define multiple boards (as is
the case with e.g. `boards/qemu/x86/`).

With extensions in the picture, the goal is to initialize platforms when
given multiple `twister.yaml` per board. The OOT files are expected to
only provide information about OOT board targets, without being able to
override in-tree targets (same principle as in the Zephyr build system).

Solution
--------

Scanning for `twister.yaml` is broken up into multiple passes - first
loading all the files, then splitting the `variants` keys apart from the
shared configuration, before constructing the Platform instances.

The purpose of the split is to treat the variant information as global,
instead of making unnecessary or faulty assumptions about locality.
Remember that the build system can derive board target names not only
from `board.yml`, but from `soc.yml` too. Considering that any board may
end up using an OOT-extended SoC (and hence multiple `soc.yml` files),
not every board target can be said to belong to some board dir.

Unlike the variant data, the remaining top-level config is still rooted
to the primary BOARD_DIR and inherited by the extension dirs from there.
This is quite intuitive in most imagined cases, but there is a caveat:
if a `twister.yaml` resides in an extension dir, then it is allowed to
have a top-level config of its own, but it will be silently ignored.
This is to support corner cases where, much like how a single board dir
can define multiple boards, a single board dir can also extend multiple
boards, or even do both. In those cases, the primary BOARD_DIR rule
should make it unambiguous which config belongs to which board, even if
it may seem counter-intuitive at first.

Upstream PR #: 84975

Signed-off-by: Grzegorz Swiderski <[email protected]>
This reverts commit 70419bd.

This is because there are issues around slow IPC thoughput
with icbmsg, which is causing issues with BLE when lots of
data is required to be exchanged, e.g. with ISO.

Also there is an assert icmsg.c#L190 which occurs when
initializing bluetooth and IPC in certain circumstances.

Upstream PR #: 85621

Signed-off-by: Sean Madigan <[email protected]>
Non-secure variants for nRF7002 DK were removed from upstream
in commit 10d4973. Revert these
changes downstream, so that the NS variants are still available.

Signed-off-by: Andrzej Głąbek <[email protected]>
…en built-in in PSA"

This reverts commit ac6d834.

Temporarily revert an upstream change that leads to a Kconfig dependency
loop with MBEDTLS_CIPHER_AES_ENABLED. This is supposed to be replaced
with a better fix later.

Signed-off-by: Andrzej Głąbek <[email protected]>
This test cannot be executed with the SDFW Service Framework client
started, so disable its initialization.

Signed-off-by: Andrzej Głąbek <[email protected]>
The BT_DRIVERS symbol default value 'y' used to depend on !BT_CTLR
but now it is always on when BT is set. For BT_RPC the BT_DRIVERS
symbol must not be enabled on the client side as no driver is used.

The temporary solution is to set BT_DRIVERS to 'y' by default only when
BT_HCI stack selection is enabled. It will be 'n' when BT_RPC_STACK
is enabled. The fix should be fine as NCS uses either HCI or RPC stack.

Signed-off-by: Michał Grochala <[email protected]>
noup because it's about partition manager.

Fix the build of secure_storage.psa.its.secure_storage.store.zms on
nrf54l15dk/nrf54l15/cpuapp by disabling partition manager, which is
incompatible with the ZMS implementation of the ITS store module.

Disabling it only for that test as it's not needed for the others
and even makes the NS board targets fail if disabling PM.

Signed-off-by: Tomi Fontanilles <[email protected]>
-Adding imply MBEDTLS_CIPHER_AES_ENABLED if not TF-M build
 in BT_CRYPTO
-Needed to set a specific symbol for MBEDTLS + MBEDTLS_BUILTIN
 to work on network core build.
-This [nrf noup] can be removed once PSA crypto is fully
 supported in network core, or PSA crypto is not compiled in at all
 and is provided as a RPC-mechanism via the app-core

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
Set CONFIG_TFM_PROFILE_TYPE_MEDIUM for boards with TF-M to enable
ITS and PS.

Enable CONFIG_PSA_WANT_GENERATE_RANDOM to fix persistent_key
tests when TF-M is used.

native_sim target needs CONFIG_PSA_WANT_ALG_ECB_NO_PADDING.

Skip checking of private_reserved field in psa_key_attributes if
present.

Increase maximum ITS asset size.

Signed-off-by: Juha Ylinen <[email protected]>
Set CONFIG_TFM_PROFILE_TYPE_MEDIUM for boards with TF-M to enable
ITS and PS.

Enable CONFIG_PSA_WANT_GENERATE_RANDOM to fix persistent_key
sample.

native_sim requires ECB cipher to be enabled.

Signed-off-by: Juha Ylinen <[email protected]>
Recent versions fixed issues for EXMIF and TDM pins as well as support
for dynamic placement of the ETR buffer.

Signed-off-by: Karsten Koenig <[email protected]>

(cherry picked from commit 5f6a3eb)
Upstream not ready yet, revert once applied there.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
Signed-off-by: Karsten Koenig <[email protected]>

(cherry picked from commit 6384b58)
nrf noup resolution - Please drop this commit after upmerge
if there is a conflict, as it should no longer be required.

This warning is raised in many places when using bluetooth.
However, it is not very useful for the user to see.

This is a noup PR as there is currently more changes coming
in around this code and how to handle deadlocks in zephyr.

Signed-off-by: Sean Madigan <[email protected]>
With code relocation directives passed to the gen_relocate_app.py script
using generated file, then each directive can be place on individual
line in the file and thus free up the `|` character as separator.

Furthermore, a multi-line file with each directive on separate line is
also more user-readable, making debugging easier.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit cb8f99a)
One might want to select the symbols to be relocated inside a file or
a library. To do this, one can use the FILTER argument of
zephyr_code_relocate which must contain a regular expression of the
section names to be selected for relocation.

The test_function_in_sram2 test case in
`tests/application_development/code_relocation` has been updated to
verify that only one function `function_in_sram()` is relocated to ram
and that the function `function_not_relocated()` is not being relocated
when using relocation filter.

Signed-off-by: Sylvain Chouleur <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 4454734)
…tem workq

Change allows performing ECDH operations through system workq. This is
done to allow reducing memory consumption by disabling the long workq on
small SoCs.

Signed-off-by: Marek Pieta <[email protected]>
(cherry picked from commit c7f3ad6)
…X is disabled

Macros for determining is low power mode shall be used where incorrect.
UARTE_ANY_LOW_POWER was taking into account only instances which had
CONFIG_UART_x_NRF_ASYNC_LOW_POWER enabled. There are also instances
with property which also can use low power mode. Created
IS_LOW_POWER_INST macro which correctly determines if instance is using
low power mode.

Upstream PR #: 85370

Signed-off-by: Krzysztof Chruściński <[email protected]>
@nordic-krch nordic-krch force-pushed the ncs/nrfx_uarte_fix_low_power_mode branch from acd4a84 to c3dc1f0 Compare February 17, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.